﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin2.master" AutoEventWireup="true" CodeFile="QuanLyNhapHang.aspx.cs" Inherits="Admin_QuanLyNhapHang" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:MultiView ID="MultiView1" runat="server">
        <asp:View ID="View1" runat="server">
        <fieldset>
            <legend style="text-align: center; font-size: 18px;color:#000000">Quản Lý Phiếu Nhập Hàng </legend><br />
       <div align="center"><br /><!--Mã sản phẩm :&nbsp; 
           <asp:TextBox ID="txtMaSP" runat="server"></asp:TextBox>&nbsp;&nbsp;<asp:Button ID="btTim"
               runat="server" Text="Tìm" Height="25px" onclick="btTim_Click" 
               Width="50px" />-->Mã phiếu nhập :&nbsp; 
           <asp:TextBox ID="txtMaPN" runat="server"></asp:TextBox>&nbsp;&nbsp;<asp:Button ID="btTimPN"
               runat="server" Text="Tìm" Height="25px" onclick="btTimPN_Click" 
               Width="50px" /><br /><br /><asp:GridView ID="gvPhieuNhap" runat="server" AutoGenerateColumns="False" 
                         Width="600px" BorderColor="#D2D2D2" 
                        BorderStyle="Solid" BorderWidth="1px" AllowPaging="True" 
                    AllowSorting="True" CellPadding="2" CellSpacing="3" DataKeyNames="MaPN" 
                    PageSize="5" onpageindexchanging="gvPhieuNhap_PageIndexChanging" 
                onrowcommand="gvPhieuNhap_RowCommand" onrowdatabound="gvPhieuNhap_RowDataBound" 
                onrowdeleting="gvPhieuNhap_RowDeleting" onrowediting="gvPhieuNhap_RowEditing">
                        <Columns>
                            <asp:BoundField DataField="MaPN" HeaderText="Mã PN" 
                                SortExpression="MAPN" ReadOnly="True" />
                            <asp:BoundField DataField="NgayNhap" HeaderText="Ngày Nhập" 
                                SortExpression="NgayNhap" ReadOnly="True" 
                                DataFormatString="{0:dd/MM/yyyy}" />
                            <asp:BoundField HeaderText="Nhà Cung Cấp" DataField="TenNhaCC" 
                                SortExpression="TenNhaCC" ReadOnly="True" />
                            <asp:BoundField HeaderText="Nhân Viên" DataField="TenNV" 
                                SortExpression="TenNV" ReadOnly="True" />
                            <asp:TemplateField HeaderText="Chọn"><ItemTemplate><div style="vertical-align:middle;margin-left:10px;"><asp:LinkButton ID="LinkButton1" CssClass="btnicon1" runat="server" 
                                        CommandName="Edit" ToolTip="Sửa phiếu nhập" 
                                        CommandArgument='<%# Eval("MaPN") %>'></asp:LinkButton><asp:LinkButton ID="LinkButton5" CssClass="btnicon5" runat="server" 
                                        CommandName="Select" ToolTip="Xem chi tiết phiếu nhập"
                                        CommandArgument='<%# Eval("MaPN") %>'></asp:LinkButton></div></ItemTemplate><ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /></asp:TemplateField>
                        </Columns>
                        <HeaderStyle BackColor="#666666" BorderColor="#D2D2D2" BorderStyle="Solid" 
                            BorderWidth="1px" Font-Bold="True" ForeColor="White" Height="50px" />
                        <PagerStyle CssClass="pagerstyle" />
                        <RowStyle Height="30px" HorizontalAlign="Center" VerticalAlign="Middle" />

                    </asp:GridView>  <br />
           <asp:Label ID="lbPNH" runat="server" ForeColor="Red"></asp:Label><br /><br />
            <asp:Button ID="btThemPhieuNhapHang" runat="server" Text="Thêm" 
                onclick="btThemPhieuNhapHang_Click" Height="25px" Width="50px" />&nbsp;&nbsp;<br />
                <br /></div>
                    </fieldset>
        </asp:View>
        <asp:View ID="View2" runat="server">
        <table border="0" width="100%" cellpadding="0" cellspacing="0">
	<tr valign="top">
	<td>
	
	
		<!--  start step-holder -->
		
		<!--  end step-holder -->
	
		<!-- start id-form -->
		<table border="0" cellpadding="0" cellspacing="0"  id="id-form">
		<tr>
			<th valign="top">
                <asp:Label ID="lbmaPM" runat="server" Text="Mã Phiếu Nhập :"></asp:Label></th>
			<td class="style1">
                <asp:TextBox ID="txtTenSanPham" runat="server" Height="25px" Width="186px" 
                    CssClass="inp-form" ReadOnly="True"></asp:TextBox>
            </td>
			<td align="center">
                
            </td>
		</tr>
        <tr>
			<th valign="top">
                <asp:Label ID="lbMaSP1" runat="server" Text="Mã Sản Phẩm :"></asp:Label></th>
			<td class="style1">
                <asp:TextBox ID="txtMaSP1" runat="server" Height="25px" Width="186px" 
                    CssClass="inp-form"></asp:TextBox>
            </td>
			<td align="center">
                <asp:RequiredFieldValidator
                    ID="RequiredFieldValidator4" runat="server" ErrorMessage="*" 
                    ControlToValidate="txtMaSP1" ForeColor="Red" ValidationGroup="themctpn"></asp:RequiredFieldValidator><asp:HiddenField ID="hdMaSP1" runat="server" />
            </td>
		</tr>
		<tr>
			<th valign="top"><asp:Label ID="lbmaSP" runat="server" Text="Tên Sản Phẩm:"></asp:Label></th>
            
			<td class="style1">
                <asp:DropDownList  ID="dlLoaiSanPham" 
                    runat="server"  AutoPostBack="True" 
                    onselectedindexchanged="dlLoaiSanPham_SelectedIndexChanged" Height="30px" 
                    Width="197px">
            </asp:DropDownList></td>
			<td align="center">
                <asp:HiddenField ID="hdSP" runat="server" />
			    &nbsp;</td>
		</tr>
		<tr>
			<th valign="top">
                <asp:Label ID="lbSoLuong" runat="server" Text="Số Lượng :"></asp:Label></th>
			<td class="style1">
                <asp:TextBox ID="txtSoLuong" runat="server" Height="25px" Width="186px" 
                    CssClass="inp-form"></asp:TextBox><asp:HiddenField ID="hdSL" runat="server" />
                
            </td>
			<td align="center">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                ControlToValidate="txtSoLuong" ErrorMessage="Số lượng không được rỗng" 
                ForeColor="Red" ValidationGroup="themctpn"></asp:RequiredFieldValidator>
            <br />
            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                ControlToValidate="txtSoLuong" ErrorMessage="Số lượng phải là số dương" 
                ForeColor="Red" ValidationExpression="\d{1,10}" ValidationGroup="themctpn"></asp:RegularExpressionValidator>
            &nbsp;<asp:RangeValidator ID="RangeValidator2" runat="server" 
                ControlToValidate="txtSoLuong" ErrorMessage="Số lượng không được bằng 0" 
                ForeColor="Red" MaximumValue="100000000" MinimumValue="1" Type="Integer" 
                    ValidationGroup="themctpn"></asp:RangeValidator>
            </td>
		</tr>
        <tr>
			<th valign="top">
                <asp:Label ID="lbGia" runat="server" Text="Giá :"></asp:Label></th>
			<td class="style1">
                <asp:TextBox ID="txtGia" runat="server" Height="25px" Width="186px" 
                    CssClass="inp-form"></asp:TextBox>
                    
            </td>
			<td align="center">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                ControlToValidate="txtGia" ErrorMessage="Giá không đươc rỗng" ForeColor="Red" 
                    ValidationGroup="themctpn"></asp:RequiredFieldValidator>
                <br />
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                ControlToValidate="txtGia" ErrorMessage="Giá phải là số dương" ForeColor="Red" 
                ValidationExpression="\d{1,10}" ValidationGroup="themctpn"></asp:RegularExpressionValidator>
            &nbsp;<asp:RangeValidator ID="RangeValidator1" runat="server" 
                ControlToValidate="txtGia" ErrorMessage="Giá không được bằng 0" ForeColor="Red" 
                MaximumValue="100000000" MinimumValue="1" Type="Integer" 
                    ValidationGroup="themctpn"></asp:RangeValidator>
            </td>
		</tr>
        
        <tr>
		<th valign="top">
            <asp:Label ID="lbNgayNhap" runat="server" Text="Ngày Nhập :"></asp:Label></th>
		<td class="noheight">
		
			<table border="0" cellpadding="0" cellspacing="0">
			<tr  valign="top">
				<td>
				<form id="chooseDateForm" action="#">
				
				<asp:DropDownList ID="dlNgay" runat="server" CssClass="styledselect-day" 
                    Width="100px">
                </asp:DropDownList>
&nbsp;</td>
				<td>
					<asp:DropDownList ID="dlThang" runat="server" 
                        CssClass="styledselect-month" Width="100px">
                    </asp:DropDownList>
&nbsp;</td>
				<td>
					
					</form>
				    <asp:DropDownList ID="dlNam" runat="server" 
                        CssClass="styledselect-year" Width="100px">
                    </asp:DropDownList>
				</td>
				<td>
                    &nbsp;</td>
			</tr>
			</table>
		
		</td>
		<td align="center" style="padding: 2px">
            <br />
            <asp:Label ID="lbNgay" runat="server" ForeColor="Red"></asp:Label>
            </td>
	</tr>
    
		<tr>
		<th valign="top">
            <asp:Label ID="lbNCC" runat="server" Text="Nhà Cung Cấp :"></asp:Label></th>
		<td class="style1">	
		    <asp:DropDownList class="styledselect_form_1" ID="dlNoiSX" runat="server" 
                CssClass="styledselect_form_1">
                
            </asp:DropDownList>&nbsp;</td>
		<td align="center"></td>
		</tr> 
        <tr>
		<th valign="top">
            <asp:Label ID="lbNV" runat="server" Text="Nhân Viên :"></asp:Label></th>
		<td class="style1">	
		    <asp:DropDownList class="styledselect_form_1" ID="dlNhanVien" runat="server" 
                CssClass="styledselect_form_1">
                
            </asp:DropDownList>&nbsp;</td>
		<td align="center"></td>
		</tr>
		
		
	
	
	
	
	<tr>
		<th>&nbsp;</th>
		<td valign="top" class="style1">
            <asp:ImageButton ID="ImageButton1" runat="server" 
                ImageUrl="~/Admin/images/forms/Chap nhan1.gif" 
                onclick="ImageButton1_Click" />&nbsp;&nbsp;<asp:ImageButton ID="ImageButton2"
                    runat="server" ImageUrl="~/Admin/images/forms/Thoat1.gif" 
                onclick="ImageButton2_Click" />&nbsp;&nbsp;<asp:ImageButton ID="ImageButton4"
                    runat="server" ImageUrl="~/Admin/images/forms/Thoat1.gif" 
                onclick="ImageButton2_Click" />&nbsp;&nbsp<asp:ImageButton 
                ID="ImageButton3" runat="server" 
                ImageUrl="~/Admin/images/forms/Chap nhan1.gif" 
                onclick="ImageButton3_Click" />
			
		</td>
		<td align="center"></td>
	</tr>
    <tr>
		<th>&nbsp;</th>
		<td valign="top" class="style1">
            <asp:ImageButton ID="ImageButton5" runat="server" 
                ImageUrl="~/Admin/images/forms/Chap nhan1.gif" 
                onclick="ImageButton5_Click" ValidationGroup="themctpn" />&nbsp;&nbsp;<asp:ImageButton ID="ImageButton6"
                    runat="server" ImageUrl="~/Admin/images/forms/Thoat1.gif" 
                onclick="ImageButton6_Click" />&nbsp;&nbsp;<asp:ImageButton ID="ImageButton7"
                    runat="server" ImageUrl="~/Admin/images/forms/Thoat1.gif" 
                onclick="ImageButton6_Click" />&nbsp;&nbsp<asp:ImageButton 
                ID="ImageButton8" runat="server" 
                ImageUrl="~/Admin/images/forms/Chap nhan1.gif" 
                onclick="ImageButton8_Click" ValidationGroup="themctpn" />
			
		</td>
		<td align="center"></td>
	</tr>
	</table>
	<!-- end id-form  -->

	</td>
	
</tr>
<tr>
<td><img src="images/shared/blank.gif" width="695" height="1" alt="blank" /></td>
<td></td>
</tr>
</table>
        </asp:View>
        <asp:View ID="View3" runat="server">
        <fieldset>
            <legend style="text-align: center; font-size: 18px;color:Silver">Quản Lý 
            Chi Tiết Phiếu Nhập Hàng </legend><br />
        <asp:GridView ID="gvCTPhieuNhap" runat="server" AutoGenerateColumns="False" 
                         Width="600px" BorderColor="#D2D2D2" 
                        BorderStyle="Solid" BorderWidth="1px" AllowPaging="True" 
                    AllowSorting="True" CellPadding="2" CellSpacing="3" DataKeyNames="MaPN,MaSP" 
                    PageSize="5" onpageindexchanging="gvCTPhieuNhap_PageIndexChanging" 
                onrowdatabound="gvCTPhieuNhap_RowDataBound" 
                onrowdeleting="gvCTPhieuNhap_RowDeleting" 
                onrowediting="gvCTPhieuNhap_RowEditing" 
                onrowcommand="gvCTPhieuNhap_RowCommand">
                        <Columns>
                            <asp:BoundField DataField="MaPN" HeaderText="Mã PN" 
                                SortExpression="MAPN" ReadOnly="True" />
                            <asp:BoundField DataField="MaSP" HeaderText="Mã SP" SortExpression="MaSP" 
                                ReadOnly="True" />
                            <asp:BoundField DataField="TenSP" HeaderText="Tên Sản Phẩm" 
                                SortExpression="TenSP" ReadOnly="True" />
                            <asp:BoundField HeaderText="Số Lượng" DataField="SoLuong" 
                                SortExpression="SoLuong" ReadOnly="True" />
                            <asp:BoundField HeaderText="Giá" DataField="Gia" SortExpression="Gia" 
                                ReadOnly="True" />
                                <asp:TemplateField HeaderText="Chọn">
                                <ItemTemplate>
                                <div style="vertical-align:middle;margin-left:10px;">
                                
                                    <asp:LinkButton ID="LinkButton1" CssClass="btnicon1" runat="server" 
                                        CommandName="Edit" ToolTip="Sửa chi tiết phiếu nhập hàng" 
                                        CommandArgument='<%# Eval("MaSP") %>' ForeColor="White" 
                                        Text='<%# Eval("MaPN") %>'></asp:LinkButton>
                                    
                                    <!--
                                    <asp:LinkButton ID="LinkButton2" CssClass="btnicon2" runat="server" 
                                        CommandName="Delete" 
                                        OnClientClick="return confirm('B&#7841;n c&oacute; ch&#7855;c ch&#7855;n mu&#7889;n x&oacute;a sản phẩm n&agrave;y không?');" 
                                        ToolTip="Xóa sản phẩm"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton3" CssClass="btnicon3" runat="server"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton4" CssClass="btnicon4" runat="server"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton5" CssClass="btnicon5" runat="server"></asp:LinkButton>-->
                                    </div>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:TemplateField>

                        </Columns>
                        <HeaderStyle BackColor="#666666" BorderColor="#D2D2D2" BorderStyle="Solid" 
                            BorderWidth="1px" Font-Bold="True" ForeColor="White" Height="50px" />
                        <PagerStyle CssClass="pagerstyle" />
                        <RowStyle Height="30px" HorizontalAlign="Center" VerticalAlign="Middle" />

                    </asp:GridView><br />
            <asp:Label ID="lbCTPNH" runat="server" ForeColor="Red"></asp:Label><br />
            <asp:Button ID="btThemCTPNhapHang" runat="server" Text="Thêm" 
                onclick="btThemCTPNhapHang_Click" Height="25px" Width="50px" />
                    <asp:HiddenField ID="hdmaPN" runat="server" />
            <asp:HiddenField ID="hdmaSP" runat="server" />
                    </fieldset>
        </asp:View>
    </asp:MultiView>

</asp:Content>

